#pragma once

#include <ostream>
#include <unordered_map>

class Parser;
class Frontend;

using TypeOption = std::unordered_map<std::string, std::string>;

extern TypeOption CppTypeOptions; // Type option for cplusplus
extern TypeOption ProtobufTypeOptions; // Type option for Protobuf
extern TypeOption CSharpTypeOptions; // Type option for CSharp
extern TypeOption GolangTypeOptions;

// JSON builder
class JsonBuilder {
    Frontend* frontend_ {nullptr};
public:
    // ctor
    JsonBuilder(Frontend* frontend);
    // dtor
    ~JsonBuilder();
    // Build a JSON object and write to os
    // @param parser Parser
    // @param os output stream
    // @param typeOption User type options for different target
    // @retval true success
    // @retval false failure
    bool build(const Parser& parser, std::ostream& os, const TypeOption& typeOptions);
};
